﻿<%@ Page Title="Mảng 1 chiều" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="MangMotChieu.aspx.cs" Inherits="Stanford.Demo.Mang.MangMotChieu" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .table
        {
            width: 600px;
        }
        .tbtitle
        {
            width: 220px;
            text-align: right;
            vertical-align:top;
        }
        .value
        {
            width: 380px;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            $("#NhapGiaTri").click(function () {
                var size = $("#<%=txtSize.ClientID %>").val();
                var html = "";
                for (var i = 0; i < size; i++) {
                    html += "<td><input type='text' id='value" + i + "'  size='5' /><td>";
                }
                $("#tbNhapGiaTri").html(html);
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table width="800" border="0" class="table">
        <tr>
            <td colspan="2">
                <h3>
                    Mảng 1 chiều trong C#</h3>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <img src="../Images/mang-mot-chieu.gif" />
            </td>
        </tr>
        <tr>
            <td class="tbtitle">
                Nhập số độ lớn mảng:
            </td>
            <td class="value">
                <asp:TextBox ID="txtSize" runat="server" Width="50"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tbtitle">
                Nhập các giá trị của mảng:<%--<a href="javascript:;" id="NhapGiaTri">--%><%--</a>--%>
            </td>
            <td class="value">
                <asp:TextBox ID="txtGiaTriMang" runat="server" Width="300"></asp:TextBox><br />
                (Mỗi phần tử cách nhau bởi dấy " ; " )<br />
                <asp:Label ID="lbThongBao" runat="server" ForeColor="Red"></asp:Label>
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <table>
                    <tr id="tbNhapGiaTri">
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="title">
            </td>
            <td class="value">
                <asp:Button ID="btnInMang" runat="server" Text="In mảng" OnClick="btnInMang_Click">
                </asp:Button>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <asp:Label ID="lbResult" runat="server"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
